package com.kingdee.pda.ui.dialog;

import android.content.Context;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;

import com.kingdee.pda.R;
import com.kingdee.pda.ui.out_check.OutCheckSnListAdapter;
import com.kingdee.pda.entity.SnlistBean;

import java.util.List;


/**
 * 出库复核sn列表展示框
 */

public class OutCheckSnListDialog {

    /**
     * 带message的弹框
     */
    public static void showSnListDialog(final Context activity, List<SnlistBean> snlistBeans) {
        View view = LayoutInflater.from(activity).inflate(R.layout.dialog_outcheck_snlist, null);
        RecyclerView recyclerView = view.findViewById(R.id.recyclerView);
        recyclerView.setLayoutManager(new LinearLayoutManager(activity));
        OutCheckSnListAdapter adapter = new OutCheckSnListAdapter(activity, snlistBeans);
        recyclerView.setAdapter(adapter);

        AlertDialog.Builder builder = new AlertDialog.Builder(activity, R.style.base_common_AlertDialogStyle);
        builder.setView(view);
        builder.setCancelable(true);
        builder.setPositiveButton("确定", null);
        AlertDialog alertDialog = builder.create();
        alertDialog.show();
    }
}
